package com.cat.dataStructure02;

/**
 * @author 曲大人的喵
 * @description https://leetcode.cn/problems/append-characters-to-string-to-make-subsequence/description/
 * @create 2025/10/18 21:40
 * @since JDK17
 */

public class Solution22 {
    public int appendCharacters(String s, String t) {
        int n = s.length(), m = t.length(), i, j;
        for (i = 0, j = 0; i < n && j < m; i++) {
            if (s.charAt(i) == t.charAt(j)) {
                j++;
            }
        }
        return m - j;
    }
}
